﻿using Abp.AutoMapper;
using Abp.Runtime.Validation;
using NetCore.Dtos;
using NetCore.Entities.Organizations;
using NetCore.Users.Dto;
using System.ComponentModel;

namespace NetCore.Organizations.Dtos
{
    /// <summary>
    /// 岗位用户
    /// </summary>
    [AutoMap(typeof(OrganizationUser)), Description("岗位用户")]
    public class OrganizationUserDto : BaseDto
    {
        /// <summary>
        /// 用户
        /// </summary>
        [Description("用户")]
        public UserDto User { get; set; }

        /// <summary>
        /// 用户
        /// </summary>
        [Description("用户")]
        public long? UserId { get; set; }
        public override void AddValidationErrors(CustomValidationContext context)
        {
            //if (!Phone.Validate())
            //{
            //    context.Results.Add(new ValidationResult("请输入正确的电话号码!"));
            //}
            //if (Files.Count > 20)
            //{
            //    context.Results.Add(new ValidationResult("批量上传文件最多20个"));
            //}

            //base.AddValidationErrors(context);
        }
    }
}
